let barWidth = '30%'
const echarts = require('echarts')

const commonBarOption = {
  tooltip: {
    show: false,
    trigger: 'item',
    formatter: '{b}({c})</br>({d}%)'
  },
  color: ['#00AEFF', '#73BF78'],
  legend: {
    show: false,
    left: 'center',
  },
  grid: {
    top: '0',
    left: 0,
    right: 0,
    bottom: '-30',
    show: false, // 默认不显示边框
    borderColor: 'white', // 边框颜色
    containLabel: true // 包含刻度文字在内
  },
  // label: {
  //   show: false,
  //   position: 'center'
  // },
  xAxis: {
    type: 'value',
    // boundaryGap: [0, 0.01],
    show: false
    // offset:-100
  },

}
let barOption_1 = {
  ...commonBarOption,
  yAxis: {
    type: 'category',
    axisTick: {
      show: false
    },
    axisLine: {
      show: false
    },
    position:'right'
  },

  series: [

    // {
    //   name: 'hill',
    //   type: 'bar',
    //   stack: 'Total',
    //   showBackground: true,
    //   backgroundStyle: {
    //     color: 'transparent'
    //   },
    //   barWidth:'50%',
    //   itemStyle: {
    //     color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
    //       {offset: 0.03, color: 'rgba(55,143,221,1)'},
    //       {offset: 0.99, color: 'rgba(0,41,72,0.2)'}
    //     ])
    //   },
    //   data: [],
    //   z: 10,
    //   label: {
    //     show: false,
    //     position: 'top'
    //   }
    // },
    {
      name: "bar1", //
      type: 'bar',
      data: [],
      barWidth: '40%',
      itemStyle:{
        borderRadius: 4,
        color: new echarts.graphic.LinearGradient(1, 1, 0, 0, [
          {offset: 0.03, color: 'rgba(0,174,255,1)'},
          {offset: 0.99, color: 'rgba(0,174,255,0)'}
        ])
      },
      showBackground:true,
      backgroundStyle:{
        color:"rgba(0,174,255,0.1)"
      }
      // type: 'bar',
      // stack: 'Total',
      // showBackground: true,
      // backgroundStyle: {
      //   color: 'transparent'
      // },
      // itemStyle: {
      //   color: '#21F5F1'
      // },
      // z: 10,
      // barMinHeight:1,
      // label: {
      //   show: false,
      //   position: 'top'
      // },
    }]
}
let barOption_2={
  ...commonBarOption,

  yAxis: {
    type: 'category',
    // data: ['互联网导出', '导入互联网'],
    axisTick: {
      show: false
    },
    axisLine: {
      show: false
    },
    position:'right'

  },
  series: [
    {
      name: "bar2", //
      type: 'bar',
      data: [],
      barWidth: barWidth,
      itemStyle:{
        borderRadius: 4,
        color: new echarts.graphic.LinearGradient(1, 1, 0, 0, [
          {offset: 0.03, color: 'rgba(136,208,141,1)'},
          {offset: 0.99, color: 'rgba(136,208,141,0.20)'}
        ])
      },
      showBackground:true,
      backgroundStyle:{
        color:"rgba(0,174,255,0.1)"
      }
    }]
}


export {
  barOption_1,
  barOption_2
}
